package com.xk.sport.backend.dao.repository;

import com.xk.sport.backend.dao.model.Area;
import com.xk.sport.backend.dao.model.Teacher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AreaDao extends JpaRepository<Area, Long>, JpaSpecificationExecutor<Area> {
    @Query(value = "select id from area where name like %?1%", nativeQuery = true)
    Long[] findIdsByName(String name);

    @Query(value = "select * from area where id in (?1)", nativeQuery = true)
    List<Area> findAreasByIds(List<Long> ids);
}
